package com.ruoyi.edh.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.edh.mapper.EdhCardCaseMapper;
import com.ruoyi.edh.domain.EdhCardCase;
import com.ruoyi.edh.service.IEdhCardCaseService;

/**
 * 易订货-卡包Service业务层处理
 * 
 * @author xxx
 * @date 2020-09-07
 */
@Service
public class EdhCardCaseServiceImpl implements IEdhCardCaseService 
{
    @Autowired
    private EdhCardCaseMapper edhCardCaseMapper;

    /**
     * 查询易订货-卡包
     * 
     * @param id 易订货-卡包ID
     * @return 易订货-卡包
     */
    @Override
    public EdhCardCase selectEdhCardCaseById(Long id)
    {
        return edhCardCaseMapper.selectEdhCardCaseById(id);
    }

    /**
     * 查询易订货-卡包列表
     * 
     * @param edhCardCase 易订货-卡包
     * @return 易订货-卡包
     */
    @Override
    public List<EdhCardCase> selectEdhCardCaseList(EdhCardCase edhCardCase)
    {
        edhCardCase.setCreateBy(SecurityUtils.getUserId());
        return edhCardCaseMapper.selectEdhCardCaseList(edhCardCase);
    }

    /**
     * 新增易订货-卡包
     * 
     * @param edhCardCase 易订货-卡包
     * @return 结果
     */
    @Override
    public int insertEdhCardCase(EdhCardCase edhCardCase)
    {
        edhCardCase.setCreateBy(SecurityUtils.getUserId());
        edhCardCase.setCreateTime(DateUtils.getNowDate());
        return edhCardCaseMapper.insertEdhCardCase(edhCardCase);
    }

    /**
     * 修改易订货-卡包
     * 
     * @param edhCardCase 易订货-卡包
     * @return 结果
     */
    @Override
    public int updateEdhCardCase(EdhCardCase edhCardCase)
    {
        edhCardCase.setUpdateBy(SecurityUtils.getUserId());
        edhCardCase.setUpdateTime(DateUtils.getNowDate());
        return edhCardCaseMapper.updateEdhCardCase(edhCardCase);
    }

    /**
     * 批量删除易订货-卡包
     * 
     * @param ids 需要删除的易订货-卡包ID
     * @return 结果
     */
    @Override
    public int deleteEdhCardCaseByIds(Long[] ids)
    {
        return edhCardCaseMapper.deleteEdhCardCaseByIds(ids);
    }

    /**
     * 删除易订货-卡包信息
     * 
     * @param id 易订货-卡包ID
     * @return 结果
     */
    @Override
    public int deleteEdhCardCaseById(Long id)
    {
        return edhCardCaseMapper.deleteEdhCardCaseById(id);
    }
}
